import 'package:flutter/material.dart';
import 'package:superclient/mvp/base/base.dart';
import 'package:superclient/mvp/contract/home_contract.dart';
import 'package:superclient/mvp/presenter/home_presenter_impl.dart';

class HomePage extends StatefulWidget {
  @override
  State createState() => _HomePageState();
}

class _HomePageState extends BaseState<HomePage, HomePresenterImpl, IHomeView>
    implements IHomeView {
  String _resp = "";

  @override
  Widget buildContent() {
    return new Scaffold(
        appBar: AppBar(),
        body: Column(
          children: <Widget>[
            FlatButton(
                onPressed: () {
                  getPresenter().getTest();
                },
                child: Text("获取当时间戳")),
            Text(_resp)
          ],
        ));
  }


  @override
  void init() {
  }

  @override
  initPresenter() {
    return HomePresenterImpl();
  }

  @override
  void showResp(String text) {
    setState(() {
      _resp = text;
    });
  }
}
